if [ $# -ne 1 ]  # Correct number of arguments passed to script?
then
  echo "Usage: `basename $0` filename"
  exit
fi

# setup global variables
# Sadly java 1.5.0 does not work with this script, so make sure
# you're using java 1.4.x

if [ $JAVA_HOME = "" ]; then
    JAVA_HOME=/usr/java/jdk1.5.0_04
fi

DOCBOOK="/usr/share/sgml/docbook/docbook-xsl-1.64.1"
export CLASSPATH=/usr/share/sgml/docbook/docbook-xsl-1.64.1/extensions/xalan2.jar:/usr/java/jdk1.5.0_04/lib/xalan.jar

$JAVA_HOME/bin/java org.apache.xalan.xslt.Process \
		    -out `basename $1 .xml`.html  \
		    -in $1  \
		    -xsl $DOCBOOK/html/profile-docbook.xsl  \
				-param ulink.target _blank \
		    -param use.extensions 1 \
		    -param tablecolumns.extension 0 \
		    -param draft.mode no \
		    -param linenumbering.extension 1 \
		    -param profile.condition fullhelp
